import { Goods } from 'src/goods/entities/goods.entity';
import {
  BaseEntity,
  Column,
  Entity,
  OneToMany,
  PrimaryGeneratedColumn,
} from 'typeorm';

@Entity()
export class Category extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  name: string;

  @Column()
  isShow: boolean;
  @Column()
  create_time: Date;
  @Column()
  update_time: Date;
  @Column({ nullable: true })
  delete_time: Date;

  @OneToMany(() => Goods, (goods) => goods.category)
  goods: Goods[];
}
